package com.csust.travel.controller;

import com.csust.travel.entity.ResBean;
import com.csust.travel.entity.TransactionReport;
import com.csust.travel.mapper.TransactionReportMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequestMapping("/transactionreport")
@RestController
@CrossOrigin
public class TransactionReportController {
    @Autowired
    TransactionReportMapper transactionReportMapper;

    @RequestMapping("/getTransactionReport")
    public ResBean getSetmealReport() {
        List<TransactionReport> nameAndNumber = transactionReportMapper.findNameAndNumber();
        Map<String, List> map = new HashMap<>();
        map.put("reportdata", nameAndNumber);
        return new ResBean(true, null, map);
    }
}
